<%@page import="com.qdu.impl.CollectImpl"%>
<%@page import="java.util.List"%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>

<HTML><HEAD><TITLE>收藏夹</TITLE>
        <META http-equiv=Content-Type content="text/html; charset=gb2312">
        <LINK 
            href=img/ys1.css type=text/css rel=stylesheet>


    </HEAD>
    <%
        String message = (String) request.getAttribute("message");
        if (message == null) {
            message = "";
        }
        if (!message.trim().equals("")) {
            out.println("<script language='javascript'>");
            out.println("alert('" + message + "');");
            out.println("</script>");
        }
        request.removeAttribute("message");

        String name = (String) session.getAttribute("name");
        if (name != null) {
    %>
    <STYLE>
        #div0{
            width:100%;
            height:50px;
            background-color:#FFCCCC;
            position:fixed;
            z-index:10;
            margin:-10px -10px 0px -10px;
        }
        #top-page{
            float:right;
            height:10px;
            white-space:nowrap;
            margin:25px 0px 0px 0px;

        }	
        #logo{
            height:50px;
            width:50px;
            float:left;
        }

    </style>
    <BODY text=#000000 bgColor=#F0FFFF leftMargin=0 topMargin=0>
        <div id="div0">
            <div id="logo">
                <img src="img/logo.jpg" style="width:100%;height:100%; margin-left:15%">
            </div>
            <div id="top-page" align="right" style="margin-right:5%">
                <div align=center>
                   <a href="/J02_T13_P04/index.jsp"><FONT color=#ffffff>首页</FONT></a><FONT color=#ffffff> │ </FONT>
                    <a href="/J02_T13_P04/newbook.jsp"><FONT color=#ffffff>最新图书</FONT></a><FONT color=#ffffff> │ </FONT>
                    <a href="/J02_T13_P04/fenlei.jsp"><FONT color=#ffffff>图书分类</FONT></a><FONT color=#ffffff> │ </FONT>
                    <a href="/J02_T13_P04/allbooklist.jsp"><FONT color=#ffffff>全部图书</FONT></a><FONT color=#ffffff> │ </FONT>
                    <a href="/J02_T13_P04/admin/login.jsp" target=_blank><FONT color=#ffffff>管理入口</FONT></a>
                </div>
            </div>
        </div>

        <TABLE cellSpacing=0 cellPadding=0 width=779 align=center border=0>
            <TBODY>
                <TR>
                    <TD width=779 >
                        <img src="img/top.jpg" width="779">
                    </TD></TR></TBODY></TABLE>

        <TABLE cellSpacing=0 cellPadding=0 width=779 align=center border=0>



            <TABLE cellSpacing=0 cellPadding=0 width=779 align=center 
                   border=0>
                <script language="javascript">
                    function check()
                    {
                        if (document.form1.login.value == "" || document.form1.email.value == "")
                        {
                            alert("必须填写所有项目！");
                            return false;
                        }
                    }
                </script>
                <TBODY>
                    <TR>
                        <TD align=center vAlign=top width=779 height=400>

                            <table bgcolor=#99CCCC align=left width=100 border=0 height=400>
                                <tr>
                                    <td align=center bordercolor="#CCFFFF" bgcolor="#99CCCC"><a href="upuser.jsp">个人信息</a></td>
                                </tr>
                                <tr>
                                    <td align=center bordercolor="#FFFFFF" bgcolor="#99CCCC"><a href="gouwuche.jsp">我的购物车</a></td> 
                                </tr>
                                <tr>
                                    <td align=center bordercolor="#FFFFFF" bgcolor="#99CCCC"><a href="shoucangjia.jsp">我的收藏夹</a></td> 
                                </tr>
                                <tr>
                                    <td align=center bordercolor="#FFFFFF" bgcolor="#99CCCC"><a href="dingdan.jsp">我的定单</a></td>
                                </tr>
                                <tr>
                                    <td align=center bordercolor="#FFFFFF" bgcolor="#99CCCC"><a href="index.jsp">返回首页</a></td>
                                </tr>
                                <tr>
                                    <td bordercolor="#FFFFFF" bgcolor="#99CCCC"><a href="">&nbsp;</a></td>
                                </tr>
                                <tr>
                                    <td bordercolor="#000000" bgcolor="#99CCCC"><a href="">&nbsp;</a></td>
                                </tr>
                                <tr>
                                    <td bordercolor="#000000" bgcolor="#99CCCC"><a href="">&nbsp;</a></td>
                                </tr>
                                <tr>
                                    <td bordercolor="#000000" bgcolor="#99CCCC"><a href="">&nbsp;</a></td>
                                </tr>
                                <tr>
                                    <td bordercolor="#000000" bgcolor="#99CCCC"><a href="">&nbsp;</a></td>
                                </tr>
                                <tr>
                                    <td bordercolor="#000000" bgcolor="#99CCCC"><a href="">&nbsp;</a></td>
                                </tr>
                                <tr>
                                    <td bordercolor="#000000" bgcolor="#99CCCC"><a href="">&nbsp;</a></td>
                                </tr>
                            </table>


                            <form action="ShouCang.jsp" method="post" name="form1" >
                                <table align=right width=660 border=1 >
                                    <tr><input type=hidden name=method value=sendorder><input type=hidden name=id value=1>
                                    <td align="center" colspan="6"><br>
                                        <span class="STYLE2">我的收藏夹</span></td>
                                    </tr>
                                    <tr>
                                        <td align="center" height="30">书名</td>
                                        <td align="center" height="30">数量</td>
                                        <td align="center" height="30">单价</td>
                                        <td align="center" height="30">加入时间</td>
                                        <td align="center" height="30">操作</td>
                                    </tr>
                                    <%
                                        List list = new CollectImpl().getMyCollect(name);
                                        if (!list.isEmpty()) {
                                            float f = 0;
                                            for (int i = 0; i < list.size(); i++) {
                                                List list2 = (List) list.get(i);
                                                f += Integer.parseInt(list2.get(1).toString()) * Float.parseFloat(list2.get(2).toString());
                                    %>
                                    <tr>
                                        <td align="center" height="30" ><%=list2.get(0).toString()%></td>
                                        <td align="center" height="30"><%=list2.get(1).toString()%></td>
                                        <td align="center" height="30"><%=list2.get(2).toString()%></td>
                                        <td align="center" height="30"><%=list2.get(3).toString()%></td>
                                        <td align="center" height="30"><a href="ShouCang.jsp?method=delgw&id=<%=list2.get(4).toString()%>">删除</a></td>
                                    </tr>
                                    <%
                                        }
                                    %>



                                    <%
                                        }
                                    %>


                                </table>

                            </form>

                        </TD>

                    </TR></TBODY></TABLE>

            <br><br>
            <br><br>
            <br>
            <div style="background:#CCFFFF;color:white;height:13;"align=center >2020-2030 网上书店  版权所有</div>
<div style="background:#FFCCCC;color:white;height:13;"align=center >2020-2030 网上书店  版权所有</div>
<div style="background:#CCFFFF;color:white;height:13;"align=center >2020-2030 网上书店  版权所有</div>
    </BODY>
    <%} else {
            response.sendRedirect("index.jsp");
        }%>
</HTML>
